package com.aaa.service.impl;

import com.aaa.entity.OmsCartItem;
import com.aaa.mapper.CartMapper;
import com.aaa.service.CartService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class CartImpl extends ServiceImpl<CartMapper, OmsCartItem> implements CartService {

    @Resource
    CartMapper cartMapper;

    @Override
    public List<Map<String, Object>> selectCart(String userid) {
        return cartMapper.selectCart(userid);
    }

    @Override
    public Integer addCart(Integer id, String price, String name,String create_date,String user_id,String num) {
        return cartMapper.addCart(id,price,name,create_date,user_id,num);
    }

    @Override
    public Integer removeProductById(String userid,String id) {
        return cartMapper.removeProductById(userid,id);
    }
}
